﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using log4net;

namespace LAPI.Core.Logging
{
    class DefaultLogger : ILogger
    {
        private ILog Logger;

        public DefaultLogger(ILog log)
        {
            Logger = log;
        }

        public bool IsEnabled(LogLevel level)
        {
            bool enabled = false;

            switch (level)
            {
                case LogLevel.Debug:
                    enabled = Logger.IsDebugEnabled; 
                    break;

                case LogLevel.Error:
                    enabled = Logger.IsErrorEnabled;
                    break;

               case LogLevel.Information:
                    enabled = Logger.IsInfoEnabled;
                    break;

                case LogLevel.Fatal:
                    enabled = Logger.IsFatalEnabled;
                    break;

                case LogLevel.Warning:
                    enabled = Logger.IsWarnEnabled;
                    break;
            }

            return enabled;
        }

        public void Log(LogLevel level, Exception exception, string format, params object[] args)
        {
        }

        public void Debug(object message)
        {
            Logger.Debug(message);
        }

        public void Debug(object message, Exception exception)
        {
            Logger.Debug(message, exception);
        }

        public void DebugFormat(string format, params object[] args)
        {
            Logger.DebugFormat(format, args);
        }

        public void Error(object message)
        {
            Logger.Error(message);
        }

        public void Error(object message, Exception exception)
        {
            Logger.Error(message, exception);
        }

        public void ErrorFormat(string format, params object[] args)
        {
            Logger.ErrorFormat(format, args);
        }

        public void Fatal(object message)
        {
            Logger.Fatal(message);
        }

        public void Fatal(object message, Exception exception)
        {
            Logger.Fatal(message, exception);
        }

        public void FatalFormat(string format, params object[] args)
        {
            Logger.FatalFormat(format, args);
        }

        public void Info(object message)
        {
            Logger.Info(message);
        }

        public void Info(object message, Exception exception)
        {
            Logger.Info(message, exception);
        }

        public void InfoFormat(string format, params object[] args)
        {
            Logger.InfoFormat(format, args);
        }

        public void Warn(object message)
        {
            Logger.Warn(message);
        }

        public void Warn(object message, Exception exception)
        {
            Logger.Warn(message, exception);
        }

        public void WarnFormat(string format, params object[] args)
        {
            Logger.WarnFormat(format, args);
        }
    }
}
